def f(h,miles):
    l=0
    high=(5*max(miles))/h
    x=0

    for mile in miles:
        if mile // high == 0 and mile % high != 0:
            x += 1

        elif mile // high != 0 and mile % high == 0:
            x += mile // high

        elif mile // high != 0 and mile % high != 0:
            x += (mile // high + 1)
        if x == h:
            print(high)
            return high

    while x!=h:
        x=0
        mid=(l+high)/2
        for mile in miles:
            if mile // mid == 0 and mile % mid != 0:
                x += 1
                print(x)

            if mile // mid != 0 and mile % mid == 0:
                     x += mile // mid
                     print(x)
            if mile // mid!= 0 and mile % mid != 0:
                        x += (mile // mid + 1)
                        print(x)

            if x == h:
                         print(mid)

                         return mid
            if x<h:
                          l=mid
                          x=0
                          break
            if x>h:
                          high=mid
                          x=0
                          break






f(5,[30,11,23,4,20])